<?php
/**
 * User: hjd-yao
 * Date: 2019/4/24
 * Time: 10:09
 */

namespace App\Http\Controllers\Shop;


use App\Http\Controllers\BackendController;
use App\Models\Shop\ShopAttributeModel;
use Illuminate\Http\Request;

class GoodsAttributeController extends BackendController
{
    /**
     * @title 获取属性
     * @param Request $request
     * @return \Illuminate\Http\JsonResponse
     */
    public function getAttributeByTypeId(Request $request)
    {
        $type_id = $request->get('goods_type');
        $attrs =  ShopAttributeModel::where('type_id',$type_id)->select(['id','title'])->get()->toArray();
        return response()->json($attrs);
    }
}